#pragma once

class ServerSystem:public Server, public Ogre::Singleton<ServerSystem>{
public:
	ServerSystem();
	~ServerSystem();

	/*
	===========================
	INTERFACE IMPLEMENTATION
	===========================
	*/
	void	init(unsigned port);
	void	shutdown();
	void	update();
	//=========================
	inline static ServerSystem &getSingleton(){return *ms_Singleton;}
	inline static ServerSystem *getSingletonPtr(){return ms_Singleton;}
private:
	///starts listening on specified port
	void	startServer(unsigned port);
	///stops listening for data on the socket
	void	stopServer();
	///checks for incoming connections
	void	manageServerSocket();
private:
	///holds listening socket
    ENetHost	*mServerSocket;
	///contains all SVActor instances of clients connected to server
	std::vector<SVActor*> mActors;
};